package com.zzz.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 响应结果枚举类
 * @author: zhai
 * @date: 2025/9/25 17:18
 * @param:
 * @return:
 **/
@Getter
@AllArgsConstructor
public enum ResultCode {

    // =========================== 成功状态 ===========================
    SUCCESS(1000, "操作成功"),

    // =========================== 系统错误 ===========================
    ERROR(2000, "服务繁忙请稍后重试"),

    // =========================== 业务错误 ===========================
    FAILED(3000, "操作失败"),
    FAILED_UNAUTHORIZED(3001, "未授权"),
    FAILED_PARAMS_VALIDATE(3002, "参数校验失败"),
    FAILED_NOT_EXISTS(3003, "资源不存在"),
    FAILED_ALREADY_EXISTS(3004, "资源已存在"),
    FAILED_PARAMS_ERROR(3005, "参数校验失败没有参数"),

    // =========================== 用户相关错误 ===========================
    FAILED_USER_EXISTS(3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS(3102, "用户不存在"),
    FAILED_LOGIN(3103, "用户名或密码错误"),
    FAILED_USER_BANNED(3104, "您已被列入黑名单，请联系管理员"),
    FAILED_PASSWORD_ERROR(3105, "密码错误"),
    FAILED_TOKEN_ERROR(3106, "token错误"),
    FAILED_USER_PERMISSION(3107, "用户权限不足"),
    FAILED_PHONE_ERROR(3108, "手机号错误"),
    FAILED_EMAIL_ERROR(3109, "邮箱号错误"),
    FAILED_SEND_CODE(3110, "发送验证码失败"),
    FAILED_CODE_ERROR(3111, "验证码错误"),
    FAILED_CODE_DAY_LIMIT(3112,"当天获取验证码次数达到上线，请第二天再次尝试" ),
    FAILED_CODE_LIMIT(3113, "请勿频繁发送验证码"),
    FAILED_LOCK_USER(3114, "用户被锁定，请联系管理员"),
    FAILED_CODE_EXPIRE(3115, "验证码已过期"),
    FAILED_USER_INFO_ERROR(3116, "用户信息错误"),

    // =========================== 题目相关错误 ===========================
    FAILED_FIND_QUESTION(3201, "题目查询失败"),
    FAILED_ADD_QUESTION(3202, "添加题目失败"),
    FAILED_QUESTION_EXISTS(3202, "添加题目失败"),
    FAILED_EDIT_QUESTION(3203, "修改题目失败"),
    FAILED_DELETE(3204, "修改题目失败"),

    // =========================== 竞赛相关错误 ===========================
    FAILED_EXAM_EDIT(3301, "修改竞赛失败"),
    EXAM_START_TIME_BEFORE_CURRENT_TIME(3302, "开始时间不能早于当前时间"),
    EXAM_START_TIME_AFTER_END_TIME(3303, "开始时间不能晚于结束时间"),
    EXAM_QUESTION_NOT_EXISTS(3304, "竞赛题目不存在"),
    EXAM_IS_PUBLISH(3305, "竞赛已经发布"),
    EXAM_NOT_HAS_QUESTION(3306, "竞赛没有题目"),
    EXAM_IS_NOT_PUBLISH(3307, "竞赛未发布"),
    EXAM_NOT_EXISTS(3308, "竞赛不存在"),
    EXAM_STARTED(3309, "竞赛已开始"),
    EXAM_IS_FINISH(3310, "竞赛已经结束"),
    EXAM_IS_UNFINISH(3310, "竞赛已经开始"),
    USER_EXAM_EXISTS(3311, "用户已参加该竞赛");
    /**
     * 状态码
     */
    private final int code;

    /**
     * 状态描述
     */
    private final String msg;
}
